Handle 24 bpp images in garmin_gpi if image width isn't a multiple of 4.
authorrobertl <robertl>
Thu, 9 Apr 2009 19:07:41 +0000 (19:07 +0000)
committerrobertl <robertl>
Thu, 9 Apr 2009 19:07:41 +0000 (19:07 +0000)
Fix from anon sf user...

garmin_gpi.c

index e2b9ec07ff8efcacb590047db8a8158f037c6c3a..2918dbf1fd28b79078e3440447a8770ac06776d0 100644 (file)
@@ -1150,6 +1150,9 @@ load_bitmap_from_file(const char *fname, char **data, int *data_sz)
                                le_write32(p, color);
                                p += 4;
                        }
+                       for (j = (src_h.width * src_h.bpp) / 8; j < src_line_sz; j++) {
+                               gbfgetc(f);  /* drop fill-in bytes */
+                       }
                        ptr -= dest_line_sz;
                }
        }